class LoginBean {
  int errcode;
  String errmsg;
  Res res;

  LoginBean({this.errcode, this.errmsg, this.res});

  factory LoginBean.fromJson(Map<String, dynamic> json) {
    return LoginBean(
      errcode: json['errcode'],
      errmsg: json['errmsg'],
      res: json['res'] != null ? Res.fromJson(json['res']) : null,
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['errcode'] = this.errcode;
    data['errmsg'] = this.errmsg;
    if (this.res != null) {
      data['res'] = this.res.toJson();
    }
    return data;
  }
}

class Res {
  String appcode;
  String appid;
  String appkey;
  String brandName;
  String callback;
  ChargeConf charge_conf;
  ConsumeConf consume_conf;
  CreditConf credit_conf;
  String first_user_charge_type;
  bool isMini;
  bool is_gift_cart;
  LoginInfo loginInfo;
  int max_amount;
  String md5key;
  String merchantNo;
  String operatorName;
  String partnerId;
  String partnerUserId;
  PayConf pay_conf;
  String pos_sign;
  String shopName;

  Res(
      {this.appcode,
      this.appid,
      this.appkey,
      this.brandName,
      this.callback,
      this.charge_conf,
      this.consume_conf,
      this.credit_conf,
      this.first_user_charge_type,
      this.isMini,
      this.is_gift_cart,
      this.loginInfo,
      this.max_amount,
      this.md5key,
      this.merchantNo,
      this.operatorName,
      this.partnerId,
      this.partnerUserId,
      this.pay_conf,
      this.pos_sign,
      this.shopName});

  factory Res.fromJson(Map<String, dynamic> json) {
    return Res(
      appcode: json['appcode'],
      appid: json['appid'],
      appkey: json['appkey'],
      brandName: json['brandName'],
      callback: json['callback'],
      charge_conf: json['charge_conf'] != null
          ? ChargeConf.fromJson(json['charge_conf'])
          : null,
      consume_conf: json['consume_conf'] != null
          ? ConsumeConf.fromJson(json['consume_conf'])
          : null,
      credit_conf: json['credit_conf'] != null
          ? CreditConf.fromJson(json['credit_conf'])
          : null,
      first_user_charge_type: json['first_user_charge_type'],
      isMini: json['isMini'],
      is_gift_cart: json['is_gift_cart'],
      loginInfo: json['loginInfo'] != null
          ? LoginInfo.fromJson(json['loginInfo'])
          : null,
      max_amount: json['max_amount'],
      md5key: json['md5key'],
      merchantNo: json['merchantNo'],
      operatorName: json['operatorName'],
      partnerId: json['partnerId'],
      partnerUserId: json['partnerUserId'],
      pay_conf:
          json['pay_conf'] != null ? PayConf.fromJson(json['pay_conf']) : null,
      pos_sign: json['pos_sign'],
      shopName: json['shopName'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['appcode'] = this.appcode;
    data['appid'] = this.appid;
    data['appkey'] = this.appkey;
    data['brandName'] = this.brandName;
    data['callback'] = this.callback;
    data['first_user_charge_type'] = this.first_user_charge_type;
    data['isMini'] = this.isMini;
    data['is_gift_cart'] = this.is_gift_cart;
    data['max_amount'] = this.max_amount;
    data['md5key'] = this.md5key;
    data['merchantNo'] = this.merchantNo;
    data['operatorName'] = this.operatorName;
    data['partnerId'] = this.partnerId;
    data['partnerUserId'] = this.partnerUserId;
    data['pos_sign'] = this.pos_sign;
    data['shopName'] = this.shopName;
    if (this.charge_conf != null) {
      data['charge_conf'] = this.charge_conf.toJson();
    }
    if (this.consume_conf != null) {
      data['consume_conf'] = this.consume_conf.toJson();
    }
    if (this.credit_conf != null) {
      data['credit_conf'] = this.credit_conf.toJson();
    }
    if (this.loginInfo != null) {
      data['loginInfo'] = this.loginInfo.toJson();
    }
    if (this.pay_conf != null) {
      data['pay_conf'] = this.pay_conf.toJson();
    }
    return data;
  }
}

class LoginInfo {
  String bid;
  String mid;
  String sid;

  LoginInfo({this.bid, this.mid, this.sid});

  factory LoginInfo.fromJson(Map<String, dynamic> json) {
    return LoginInfo(
      bid: json['bid'],
      mid: json['mid'],
      sid: json['sid'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['bid'] = this.bid;
    data['mid'] = this.mid;
    data['sid'] = this.sid;
    return data;
  }
}

class CreditConf {
  bool must_bind_phone;

  CreditConf({this.must_bind_phone});

  factory CreditConf.fromJson(Map<String, dynamic> json) {
    return CreditConf(
      must_bind_phone: json['must_bind_phone'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['must_bind_phone'] = this.must_bind_phone;
    return data;
  }
}

class PayConf {
  int is_alipay;
  bool is_quick;
  int is_union;
  int is_wxpay;

  PayConf({this.is_alipay, this.is_quick, this.is_union, this.is_wxpay});

  factory PayConf.fromJson(Map<String, dynamic> json) {
    return PayConf(
      is_alipay: json['is_alipay'],
      is_quick: json['is_quick'],
      is_union: json['is_union'],
      is_wxpay: json['is_wxpay'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['is_alipay'] = this.is_alipay;
    data['is_quick'] = this.is_quick;
    data['is_union'] = this.is_union;
    data['is_wxpay'] = this.is_wxpay;
    return data;
  }
}

class ConsumeConf {
  bool must_bind_phone;
  bool must_follow;

  ConsumeConf({this.must_bind_phone, this.must_follow});

  factory ConsumeConf.fromJson(Map<String, dynamic> json) {
    return ConsumeConf(
      must_bind_phone: json['must_bind_phone'],
      must_follow: json['must_follow'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['must_bind_phone'] = this.must_bind_phone;
    data['must_follow'] = this.must_follow;
    return data;
  }
}

class ChargeConf {
  bool allow_cashier_add_emp;
  bool is_cashier_commssion;
  bool is_recommender_commssion;

  ChargeConf(
      {this.allow_cashier_add_emp,
      this.is_cashier_commssion,
      this.is_recommender_commssion});

  factory ChargeConf.fromJson(Map<String, dynamic> json) {
    return ChargeConf(
      allow_cashier_add_emp: json['allow_cashier_add_emp'],
      is_cashier_commssion: json['is_cashier_commssion'],
      is_recommender_commssion: json['is_recommender_commssion'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['allow_cashier_add_emp'] = this.allow_cashier_add_emp;
    data['is_cashier_commssion'] = this.is_cashier_commssion;
    data['is_recommender_commssion'] = this.is_recommender_commssion;
    return data;
  }
}
